package keeto.com.vn.classfied.model;

import android.text.style.ClickableSpan;
import android.view.View;


/**
 * 
 * a. Keep a object
 * b. Can convert to include data structure as json string
 * 
 */
public class ClickSpan extends ClickableSpan {

	private OnClickListener mListener;

	private UserUIModel mUser = null;
	
	public ClickSpan(OnClickListener listener, UserUIModel user) {
		mListener = listener;
		mUser = user;
	}

	@Override
	public void onClick(View widget) {
		if (mListener != null)
			mListener.onClick(mUser);
	}

	public interface OnClickListener {
		void onClick(UserUIModel user);
	}
	
	@Override
	public String toString() {
		return mUser.toString();
	}

	public UserUIModel getUser() {
		return mUser;
	}

	public void setUser(UserUIModel mUser) {
		this.mUser = mUser;
	}

}
